<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    // 解构赋值
    // 解：解开、展开
    // 构：结构（在JS中，有结构的是数组和对象）
    // 赋值：把一个值，赋值给变量
    // 解构赋值：展开数组或对象，把里面的值取出，赋值给变量
    let { uname, age } = { uname: 'zs', age: 20 }
    // let uname = 'zs'
    // let age = 20
    // console.log(uname)
    // { uname, age, data } = { uname: 'zs', age: 20, data: 'hello world' }
     function fn({ uname: res }) {
     console.log(res)
     }
     fn({ uname: 'zs', age: 20, data: 'hello world' })
    </script>
</body>
</html>